﻿// <copyright file="Attributes.cs" company="Oleg V. Polikarpotchkin">
// Copyright © 2008-2009 Oleg V. Polikarpotchkin. All Right Reserved
// </copyright>
// <author>Oleg V. Polikarpotchkin</author>
// <email>ov-p@yandex.ru</email>
// <date>2009-05-10</date>
// <summary>OpenWPFChart library. Attributes.</summary>
// <revision>$Id$</revision>

using System;

namespace OpenWPFChart.Parts
{
	/// <summary>
	/// Attribute indicating that the class it's applied uses an interpolation.
	/// </summary>
	[Serializable]
	[AttributeUsage(AttributeTargets.Class)]
	public class InterpolatedAttribute : Attribute
	{
		/// <summary>
		/// Initializes a new instance of the <see cref="InterpolatedAttribute"/> class.
		/// </summary>
		/// <param name="description">The interpolator user-readable description.</param>
		public InterpolatedAttribute(string description)
		{
			Description = description;
		}

		/// <summary>
		/// Gets or sets the interpolator user-readable description.
		/// </summary>
		/// <value>Arbitrary string.</value>
		public string Description { get; private set; }
	}

	/// <summary>
	/// Defines the <see cref="ChartScale"/> derived class Group membership.
	/// </summary>
	/// <remarks>
	/// The Group of Chart Scales is intended to contain the <see cref="ChartScale"/> derived 
	/// classes which could be used interchangeable under certain circumstances (e.g.
	/// <see cref="ChartLinearScale"/> and <see cref="ChartLogarithmicScale"/> classes).
	/// <para>Two classes which have this attribute with the same tag value are regarded as
	/// belonging to the same Group of Chart Scales.</para>
	/// <para>Class belonging to the Group must provide that class user-readable description.</para>
	/// <para>Optionally the Group user-readable description may be provided.</para>
	/// </remarks>
	[Serializable]
	[AttributeUsage(AttributeTargets.Class, Inherited=false)]
	public sealed class ChartScaleGroupAttribute : Attribute
	{
		/// <summary>
		/// Initializes a new instance of the <see cref="ChartScaleGroupAttribute"/> class.
		/// </summary>
		/// <param name="tag">The Scale Group Tag. Typically it's the type of the one of
		/// classes in the Chart Scales Group.</param>
		/// <param name="classDescription">The Group item description.</param>
		/// <remarks>
		/// Two classes which have this attribute with the same tag value are regarded as
		/// belonging to the same Scale Group.
		/// <para>Class belonging to the Group must provide that class user-readable description.</para>
		/// </remarks>
		public ChartScaleGroupAttribute(Type tag, string classDescription)
		{
			TagType = tag;
			ClassDescription = classDescription;
		}

		/// <summary>
		/// Gets the type used as the Tag for this Scale Group.
		/// </summary>
		/// <value>The Scale Group Tag.</value>
		/// <remarks>
		/// Two classes which have this attribute with the same tag value are regarded as
		/// belonging to the same Scale Group.
		/// </remarks>
		public Type TagType { get; private set; }

		/// <summary>
		/// Gets or sets the Scale Group user-readable description.
		/// </summary>
		/// <value>Arbitrary string.</value>
		public string GroupDescription { get; set; }

		/// <summary>
		/// Gets or sets the Scale class user-readable description.
		/// </summary>
		/// <value>Arbitrary string.</value>
		public string ClassDescription { get; private set; }
	}
}
